import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class UdpClient {

	public static void main(String[] args) throws Exception {
		String s = "i am client!";
		DatagramSocket sk = new DatagramSocket();
		InetAddress ia = InetAddress.getByName("172.19.90.14");
		DatagramPacket ds = new DatagramPacket(s.getBytes(), 5, ia, 7777);
		sk.send(ds);

		byte[] data = new byte[1024];
		DatagramPacket recP = new DatagramPacket(data, 1024);
		sk.receive(recP);
		String str = new String(recP.getData(), 0, recP.getLength());
		System.out.println(str);

		sk.close();

	}

}
